package com.young.springdemo.service.builderFactoryTest;
//电脑抽象建造类
public abstract class ComputerBuilder {

    public Computer computer = new Computer();

    public abstract void buildCpu();
    public abstract void buildMemory();
    public abstract void buildHardDisk();
    public abstract void buildHost();
    public abstract void buildScreen();

    //不要显示器的主机
    public boolean isScreen(){
        return false;
    }

    public Computer construct(){
        this.buildCpu();
        this.buildMemory();
        this.buildHardDisk();
        this.buildHost();
        if (!isScreen()){
            this.buildScreen();
        }
        return computer;
    }

}
